trigger DeleteCSERecord on ConsumerEducation__c (before delete) {
    if(system.trigger.isdelete){
     Profile p  = [select id from profile where name=: 'System Administrator' or name =: '系统管理员']; 
     for (ConsumerEducation__c cs : Trigger.old)
     {
         if((cs.ownerid != UserInfo.getUserId())&&(p.id != UserInfo.getProfileId())&& cs.deleteMark__c==false){
             cs.addError('您无权删除该计划!');
         }
         if((cs.Date__c <= Date.Today())&&(p.id != UserInfo.getProfileId()) && cs.deleteMark__c==false ){
             cs.addError('该记录不能被删除!');
         }
     }
    }
}